package com.zy.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zy.business.domain.TbDailyReport;
import com.zy.business.domain.TbDailyReportAnnotate;
import com.zy.business.domain.TbUserDailyReport;
import com.zy.common.core.domain.AjaxResult;
import com.zy.common.core.domain.entity.SysUser;
import com.zy.common.core.page.TableDataInfo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 日报管理接口
 */
public interface DailyReportService extends IService<TbDailyReport> {

    /**
     * 添加日报
     * @param userDailyReport
     * @return
     */
    AjaxResult addDailyReport(TbUserDailyReport userDailyReport);

    /**
     * 修改日报
     * @param userDailyReport
     * @return
     */
    AjaxResult editDailyReport(TbUserDailyReport userDailyReport);

    /**
     * 获取成员日报列表
     * @param user
     * @param reportDate
     * @return
     */
    List<TbUserDailyReport> selectReportList(SysUser user, String reportDate);

    /**
     * 导出成员日报
     * @param user
     * @param reportDate
     * @param request
     * @param response
     */
    void exportWord(SysUser user,String reportDate, HttpServletRequest request, HttpServletResponse response);

    /**
     * 获取我的日报
     * @param month
     * @return
     */
    List<Map<String, Object>> selectMyData(String month);

    /**
     * 获取日报统计列表
     * @param deptId
     * @param month
     * @return
     */
    TableDataInfo reportList(Long deptId, String month);

    /**
     * 根据项目id和用户id获取日报列表
     * @param userName
     * @param projectId
     * @param reportDate
     * @return
     */
    List<TbDailyReport> getReportListByProject(String userName, Long projectId, String reportDate);

    /**
     * 保存批注
     *
     * @param annotate
     * @return
     */
    int saveComments(TbDailyReportAnnotate annotate);

    /**
     *修改状态为已读
     * @param id
     * @return
     */
    AjaxResult changeView(Long id);

    /**
     * 手机端分页获取我的日报列表
     * @param startDate
     * @param endDate
     * @return
     */
    List<TbUserDailyReport> getMyReportListByDate(String startDate, String endDate);

    /**
     * 验证所选日期是否已存在日报
     * @param reportDate
     * @return
     */
    Boolean verify(String reportDate);

    /**
     * 根据日期获取日报信息
     * @param userId
     * @param date
     * @return
     */
    AjaxResult getReportByDate(Long userId, String date);

    /**
     * 修改批注
     *
     * @param annotate
     * @return
     */
    int editComments(TbDailyReportAnnotate annotate);

    /**
     * 手机端点击查看日报详情
     * @param reportId
     * @return
     */
    AjaxResult getDetail(Long reportId);
}
